-
Notifications
You must be signed in to change notification settings - Fork 1.8k
add class Machine and classes Truck, Bulldozer, and Excavator #2406
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: master
Are you sure you want to change the base?
Conversation
…thods doWork() and stopWork().
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Review Summary
Decision: APPROVE
Why: All core requirements are fully met: Machine
is abstract with doWork()
/stopWork()
, subclasses override correctly with clear English messages, and MainApp
uses a Machine[]
and loops calling both methods. Functionality is correct and nothing blocks execution.
Minor improvements (non-blockers):
- Remove redundant empty lines immediately after the package declaration in these files:
Machine.java
,MainApp.java
,Truck.java
,Bulldozer.java
,Excavator.java
(violates the “no redundant empty lines” checklist). For example, in each file, delete the blank line right afterpackage core.basesyntax;
. - Remove redundant semicolons after method bodies in
Truck.java
,Bulldozer.java
, andExcavator.java
(e.g., after the closing brace ofdoWork()
), as they’re unnecessary.
Great job on abstraction and polymorphism. Tidy up the minor style issues when you can to align perfectly with the checklist.
✨ Please rate this review in the Platform's notification center1. I will be grateful for your feedback! ✨
Footnotes
@@ -0,0 +1,12 @@ | |||
package core.basesyntax; | |||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
There is a redundant empty line after the package declaration. This violates checklist item: "Please don't add redundant empty lines to your code."
@Override | ||
public void doWork(){ | ||
System.out.println("Bulldozer started work"); | ||
}; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
There is a redundant semicolon after the closing brace of the doWork() method. While this does not break functionality, it is unnecessary and should be removed for cleaner code.
@@ -0,0 +1,12 @@ | |||
package core.basesyntax; | |||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
There is a redundant empty line after the package declaration. This violates checklist item: "Please don't add redundant empty lines to your code."
@Override | ||
public void doWork(){ | ||
System.out.println("Excavator started work"); | ||
}; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
There is a redundant semicolon after the closing brace of the doWork() method. While this does not break functionality, it is unnecessary and should be removed for cleaner code.
@@ -0,0 +1,6 @@ | |||
package core.basesyntax; | |||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
There is a redundant empty line after the package declaration. This violates checklist item: "Please don't add redundant empty lines to your code."
@@ -1,5 +1,11 @@ | |||
package core.basesyntax; | |||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
There is a redundant empty line after the package declaration. This violates checklist item: "Please don't add redundant empty lines to your code."
@@ -0,0 +1,12 @@ | |||
package core.basesyntax; | |||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
There is a redundant empty line after the package declaration. This violates checklist item: "Please don't add redundant empty lines to your code."
@Override | ||
public void doWork(){ | ||
System.out.println("Truck started work"); | ||
}; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
There is a redundant semicolon after the closing brace of the doWork() method. While this does not break functionality, it is unnecessary and should be removed for cleaner code.
Also added methods doWork() and stopWork().